package com.fulin.leetcode;

/**
 * TODO
 *
 * @Author fulin
 * @Date 2022/8/13 12:58
 **/
public class fanzhuan {
    public static void main(String[] args) {
        int num = -1234;
        System.out.println(revert(num));
    }

    public static int revert(int data){
        if (data == 0){
            return 0;
        }

        int result = 0;

        while(data != 0){
            int mod = data % 10;
            data /= 10;
            result = result * 10 + mod;
        }

        return result;
    }
}
